﻿{layout:default} {class:Shop.Supplier.Config.EmailConfig}
<lbhead>
    <title><%=Tag("邮件设置")%>-<%=site.title%></title>
</lbhead>
<lbpath>
    <div class="tools">
        <ul>
            <%if (PageReturnMsg == ""){%>
            <li class="submit"><a href="javascript:void(0);" onclick="SaveObj();"><b></b><span><%=Tag("保存")%></span></a></li>
            <li class="email"><a href="javascript:void(0);" onclick="Send();"><b></b><span><%=Tag("测试")%></span></a></li>
            <%}%>
            <li class="mes"><span id="Span1"><font id="mes"></font></span></li>
            <li class="name"><span id="navIgation">
                <%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_supplier.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a> >
                <%=Tag("邮件设置") %></span></li>
        </ul>
    </div>
</lbpath>
<lbbody>
    <table class="table">
        <tbody>
            <tr>
                <th>
                    <%=Tag("发信邮箱")%>：
                </th>
                <td>
                    <input type="text" class="input" id="MailAddress" name="MailAddress" shop="true" style="width: 200px;"
                        value="<%=model.MailAddress %>" />
                </td>
            </tr>
            <tr>
                <th>
                    <%=Tag("SMTP Server地址")%>：
                </th>
                <td>
                    <input type="text" class="input" id="SmtpAddress" name="SmtpAddress" shop="true"
                        style="width: 200px;" value="<%=model.SmtpAddress %>" />
                    <em><%=Tag("如：smtp.163.com")%></em>
                </td>
            </tr>
            <tr>
                <th>
                    <%=Tag("端口")%>：
                </th>
                <td>
                    <input type="text" class="input" id="MailPort" name="MailPort" shop="true"
                           style="width: 60px;" value="<%=model.MailPort %>"  onkeyup="value=value.replace(/[^\d]/g,'')" />
                    <em>25</em>
                    &nbsp;&nbsp;
                    <label><input type="checkbox" name="MailIsSSL" value="1" shop="true" <%=model.MailIsSSL=="1"?"checked":"" %> /><%=Tag("SSL")%></label>
                </td>
            </tr>
            <tr>
                <th>
                    <%=Tag("邮件登陆名")%>：
                </th>
                <td>
                    <input type="text" class="input" id="MailName" name="MailName" shop="true" style="width: 200px;"
                        value="<%=model.MailName %>" />
                </td>
            </tr>
            <tr>
                <th>
                    <%=Tag("登陆密码")%>：
                </th>
                <td>
                    <input type="password" id="MailPassWord" name="MailPassWord" shop="true" style="width: 200px;"
                        value="<%=password %>" class="input" size="21" />
                </td>
            </tr>
            <tr>
                <th>
                    <%=Tag("发信名称")%>：
                </th>
                <td>
                    <input type="text" class="input" id="MailDisplayName" name="MailDisplayName" shop="true" style="width: 200px;"
                        value="<%=model.MailDisplayName %>" />
                </td>
            </tr>
            <tr>
                <th>
                    <%=Tag("抄送邮箱")%>：
                </th>
                <td>
                    <input type="text" class="input" id="AdminMailAddress" name="AdminMailAddress" shop="true" style="width: 200px;"
                        value="<%=model.AdminMailAddress %>" />
                </td>
            </tr>
            <tr>
                <th>
                    <%=Tag("发件设置")%>：
                </th>
                <td>
                    <%string ams = model.AdminMailSign;
                      if (ams == null)
                          ams = "";
                      ams = ams.ToLower();
                        %>
                    <label><input type="checkbox" name="AdminMailSign" value="ordersubmit" shop="true" <%=ams.Contains("ordersubmit")?"checked":"" %> /><%=Tag("订单提交")%></label>
                    <%if (CurrentSupplier.IsSupplierTransport == 0){%>
                    <label><input type="checkbox" name="AdminMailSign" value="orderpaid" shop="true" <%=ams.Contains("orderpaid")?"checked":"" %> /><%=Tag("订单付款")%></label>
                    <label><input type="checkbox" name="AdminMailSign" value="ordercomment" shop="true" <%=ams.Contains("ordercomment")?"checked":"" %> /><%=Tag("订单留言")%></label>
                    <label><input type="checkbox" name="AdminMailSign" value="comment" shop="true" <%=ams.Contains("comment")?"checked":"" %> /><%=Tag("商品评论")%></label>
                    <label><input type="checkbox" name="AdminMailSign" value="ask" shop="true" <%=ams.Contains("ask")?"checked":"" %> /><%=Tag("商品咨询")%></label>
                    <%}%>
                </td>
            </tr>
        </tbody>
    </table>
    <script type="text/javascript">
        function SaveObj() {
            var postData = GetFormJsonData("shop");
            var url="<%=site.AdminPath %>/ajax/ajax_config.aspx?__Action=EmailConfig_Edit";
            RequestAjax(url,postData,function(res){MsgBox(1, "<%=Tag("操作成功")%>", "")});
        }
        function Send() {
            var url="<%=site.AdminPath %>/ajax/ajax_config.aspx?__Action=EmailTestSend";
            RequestAjax(url,"",function(res){MsgBox(1, "<%=Tag("操作成功")%>", "")});
        }
    </script>
</lbbody>
<lbbottom>
    <input type="hidden" id="pwd" runat="server" />
</lbbottom>
